import { prefixImg } from '@/tool/index'
// import { setStore } from '@/config/mUntils.js'

const loginStatusMixin = {
  data () {
    return {
      prefixImg,
      msg: '你登录了木'
    }
  }
}

const errorImageMixin = {
  methods: {
    catchErrorImage (e) {
      e.target.src = require('img/newload.png')
    }
  }
}

const judgeWareHouseIdMixin = {
  methods: {
    judgeWareHouseId () {
      if (this.loginStatus === 1) {
        this.fetchWarehouseId().then(res => {
          if (!res) {
            this.fetchWarehouseId(true)
          }
        })
      } else {
        this.fetchWarehouseId(true)
      }
    }
  }
}
export {
  loginStatusMixin,
  errorImageMixin,
  judgeWareHouseIdMixin
}
